package com.homework;

public class demo01 {
    public static void main(String[] args) {
        int[] arr = new int[]{11, 22, 33, 44, 55, 66};
        test1(arr, 1, 5);
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i] + " ");
        }
    }


    public static void test1(int[] arr, int m, int n) {
        //定义临时值
        int temp = arr[n];
        arr[n] = arr[m];
        arr[m] = temp;
    }
}
